package ar.scheduler.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class Config {
	
	private String hostname = "";
	private String username = "";
	private String password = "";
	private String remotedir = "";
	private String file = "";
		
	public String getHostname() {
		return hostname;
	}

	public void setHostname(String hostname) {
		this.hostname = hostname;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRemotedir() {
		return remotedir;
	}

	public void setRemotedir(String remotedir) {
		this.remotedir = remotedir;
	}

	public void loadProperties(FileInputStream propFile, Config configs){
		Properties prop = new Properties();
		
		try {
			prop.load(propFile);
			configs.setHostname(prop.getProperty("hostname"));
			configs.setUsername(prop.getProperty("username"));
			configs.setPassword(prop.getProperty("password"));
			configs.setRemotedir(prop.getProperty("remotedir"));
			configs.setFile(prop.getProperty("file"));
			
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}

	public String getFile() {
		return file;
	}

	public void setFile(String file) {
		this.file = file;
	}

}
